home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / PASCSRC.ZIP / OT4.PAS < prev    next >
Pascal/Delphi Source File  |  1988-01-15  |  22KB  |  561 lines

  1. program Oak_Tree;         (* This version is for TURBO Pascal 4.0 *)
  2.  
  3. (*                 XXX     X    X   X  XXXXX  XXXX   XXXXX  XXXXX
  4.   Jan 15, 1988    X   X   X X   X  X     X    X   X  X      X
  5.                   X   X  X   X  X X      X    X   X  X      X
  6.                   X   X  X   X  XX       X    XXXX   XXX    XXX
  7.                   X   X  XXXXX  X X      X    X X    X      X
  8.                   X   X  X   X  X  X     X    X  X   X      X
  9.                    XXX   X   X  X   X    X    X   X  XXXXX  XXXXX
  10. *)
  11.  
  12. uses Dos, Printer;
  13.  
  14. const  Page_Size = 66;
  15.        Max_Lines = 55;
  16.  
  17. type   Command_String = string[127];
  18.  
  19.        Output_Type = (Directories,Files);
  20.  
  21.        Dir_Rec     = ^Dirtree;    (* Dynamic storage for dir names *)
  22.        Dirtree     = record
  23.          Next      : Dir_Rec;
  24.          Dir_Name  : string[12];
  25.       end;
  26.  
  27.        Filerec     = ^Filetree;         (* Dynamic storage for the *)
  28.        Filetree    = record             (* filename sorting tree   *)
  29.          Left      : Filerec;
  30.          Right     : Filerec;
  31.          FileData  : SearchRec;                 (* From Dos module *)
  32.        end;
  33.  
  34. (*  Record definition from page 408 of the TURBO Pascal 4.0 manual *)
  35. (*     type SearchRec = record                                     *)
  36. (*                        Fill : array[1..21] of byte;             *)
  37. (*                        Attr : byte;                             *)
  38. (*                        Time : longint;                          *)
  39. (*                        Size : longint;                          *)
  40. (*                        Name : string[12];                       *)
  41. (*                      end;                                       *)
  42.  
  43. var   File_Record    : SearchRec;      (* A working file record    *)
  44.       File_Point     : Filerec;        (* Pointer to a file record *)
  45.       Page_Number    : integer;
  46.       Line_Number    : integer;
  47.       Directory_Count : integer;
  48.       Recpack        : Registers;               (* From Dos module *)
  49.       File_Request   : string[25];
  50.       Root_Mask      : Command_String;(* Used for vol-label search *)
  51.       Starting_Path  : Command_String;
  52.  
  53.       Total_Clusters      : longint;
  54.       Disk_Total_Bytes    : longint;
  55.       Cluster_Size        : integer;
  56.       Sectors_Per_Cluster : integer;
  57.       Bytes_Per_Sector    : integer;
  58.       Free_Clusters       : longint;
  59.       Free_Bytes          : longint;
  60.       Total_Cbytes        : longint;
  61.       Total_Bytes         : longint;
  62.       All_Files           : integer;    (* Number of files on disk *)
  63.       Req_Files           : integer; (* Number of files in request *)
  64.  
  65.       Do_We_Print    : boolean;           (* Print or not          *)
  66.       Do_All_Stats   : boolean;           (* List all disk stats?  *)
  67.       No_Files_Out   : boolean;           (* List no files         *)
  68.       Date_Time_Rec  : DateTime;          (* From Dos module       *)
  69.  
  70. (* **************************************************** Initialize *)
  71. (* This procedure is used to initialize some variables and strings *)
  72. (* prior to starting the disk search.                              *)
  73. procedure Initialize;
  74. begin
  75.    Page_Number := 1;
  76.    Line_Number := 1;
  77.    Directory_Count := 0;
  78.    Total_Cbytes := 0;
  79.    Total_Bytes := 0;
  80.    All_Files := 0;
  81.    Req_Files := 0;
  82.    Root_Mask := 'C:\*.*';
  83.    Root_Mask[Length(Root_Mask) + 1] := Chr(0);
  84.                            (* Get the current default drive letter *)
  85.    Recpack.AX := $1900;
  86.    Intr($21,Recpack);
  87.    Root_Mask[1] := Chr(Recpack.AX and $F + Ord('A'));
  88. end;
  89.  
  90. (* ****************************** Read And Parse Command Arguments *)
  91. (* This procedure reads in the command line arguments, parses them,*)
  92. (* and sets up the switches and defaults for the disk searches.    *)
  93. procedure Read_And_Parse_Command_Arguments;
  94. var    Parameters         : Command_String;
  95.        Index              : byte;
  96. begin
  97.    Do_We_Print := FALSE;
  98.    Do_All_Stats := FALSE;
  99.    No_Files_Out := FALSE;
  100.    File_Request := '*.*';
  101.  
  102.    for Index := 1 to ParamCount do begin
  103.       Parameters := ParamStr(Index);
  104.       Writeln(Parameters); (* ************ Temporary ***************)
  105.                                      (* Find command line switches *)
  106.       if Parameters[1] = '/' then begin
  107.          if Upcase(Parameters[2]) = 'P' then Do_We_Print := TRUE;
  108.          if Upcase(Parameters[2]) = 'N' then No_Files_Out := TRUE;
  109.          if Upcase(Parameters[2]) = 'S' then Do_All_Stats := TRUE;
  110.       end
  111.       else begin                   (* Find designated drive letter *)
  112.          if Parameters[2] = ':' then begin
  113.             Root_Mask[1] := Parameters[1];
  114.             Delete(Parameters,1,2);
  115.          end;
  116.  
  117.          if Parameters = '' then              (* No filename given *)
  118.             File_Request := '*.*'
  119.          else                                   (* Filename listed *)
  120.             File_Request := Parameters;
  121.       end;
  122.    end;
  123.                      (* get the current path on the selected drive *)
  124.    Getdir(Ord(Root_Mask[1])-Ord('A') + 1,Starting_Path);
  125.    if Length(Starting_Path) > 3 then
  126.       Starting_Path := Starting_Path + '\';
  127.  
  128. end;
  129.  
  130. (* ********************************************* count print lines *)
  131. procedure Count_Print_Lines(Line_Count : byte);
  132. var Count : byte;
  133. begin
  134.    if Do_We_Print then begin
  135.       if Line_Count > 250 then (* This signals the end of the tree *)
  136.       begin                    (* Space up to a new page           *)
  137.          for Count := Line_Number to (Page_Size - 3) do
  138.             Writeln(Lst);
  139.          Line_Number := 1;
  140.          Line_Count := 0;
  141.       end;
  142.       Line_Number := Line_Number + Line_Count;
  143.       if Line_Number > Max_Lines then begin
  144.          Page_Number := Page_Number +1;
  145.          for Count := Line_Number to (Page_Size - 2) do
  146.             Writeln(Lst);
  147.          Writeln(Lst,'                           Page',
  148.                                                Page_Number:4);
  149.          Writeln(Lst);
  150.          Line_Number := 1;
  151.       end;
  152.    end;
  153. end;
  154.  
  155. (* ************************************************** Print Header *)
  156. (* In this section of code, the volume label is found and displayed*)
  157. (* and the present time and date are determined and displayed.     *)
  158. procedure Print_Header;
  159. var Year,Month,Day,DayOfWeek  : word;
  160.     Hour,Minute,Second,Sec100 : word;
  161.     Index                 : integer;
  162. begin
  163.    if Do_We_Print then begin
  164.       Writeln(Lst);
  165.       Writeln(Lst);
  166.       Writeln(Lst);
  167.       Write(Lst,'          Directory for ');
  168.    end;
  169.    Write('          Directory for ');
  170. {  Recpack.AX := $1A00;                          (* Set up the DTA *)
  171.    Recpack.DS := Seg(Dta);
  172.    Recpack.DX := Ofs(Dta);
  173.    Msdos(Recpack);                           (* DTA setup complete *)
  174.    Error := Recpack.AX and $FF;
  175.    if Error > 0 then Writeln('DTA setup error ',Error);
  176.  }
  177.    FindFirst(Root_Mask,$08,File_Record);      (* Get the volume ID *)
  178.    if ((DosError > 0) or (File_Record.Attr <> 8)) then begin
  179.       if Do_We_Print then
  180.          Write(Lst,' <no vol label> ');
  181.       Write(' <no vol label> ');
  182.    end
  183.    else begin                            (* Write out Volume Label *)
  184.       if Do_we_Print then
  185.          Write(Lst,File_Record.Name);
  186.       Write(File_Record.Name);
  187.    end;
  188.  
  189.    GetDate(Year,Month,Day,DayOfWeek);      (* Get the present date *)
  190.    GetTime(Hour,Minute,Second,Sec100);     (* Get the present time *)
  191.    Write('             ');
  192.    Write(Month,'/',Day,'/',Year);
  193.    Writeln('    ',Hour,':',Minute);
  194.    Writeln;
  195.    if Do_We_Print then begin
  196.       Write(Lst,'             ');
  197.       Write(Lst,Month,'/',Day,'/',Year);
  198.       Writeln(Lst,'    ',Hour,':',Minute);
  199.       Writeln(Lst);
  200.       Count_Print_Lines(2);
  201.    end;
  202.                                   (* get all of the disk constants *)
  203.    Recpack.AX := $3600;
  204.    Recpack.DX := (Ord(Root_Mask[1]) - 64) and $F;
  205.    Msdos(Recpack);
  206.    Sectors_Per_Cluster := Recpack.AX;
  207.    Free_Clusters := Recpack.BX;
  208.    Bytes_Per_Sector := Recpack.CX;
  209.    Total_Clusters := Recpack.DX;
  210.  
  211.    Cluster_Size := Bytes_Per_Sector * Sectors_Per_Cluster;
  212.  
  213.    if Do_All_Stats then begin (* Print out disk stats if asked for *)
  214.       Write('             bytes/sector =',Bytes_Per_Sector:6);
  215.       Disk_Total_Bytes := Total_Clusters * Cluster_Size;
  216.       Writeln('       total disk space =',Disk_Total_Bytes:12);
  217.       Write('            bytes/cluster =',Cluster_Size:6);
  218.       Free_Bytes := Free_Clusters * Cluster_Size;
  219.       Writeln('        free disk space =',Free_Bytes:12);
  220.       Writeln;
  221.       if Do_We_Print then begin
  222.          Write(Lst,'             bytes/sector =',Bytes_Per_Sector:6);
  223.          Writeln(Lst,'       total disk space =',
  224.                                              Disk_Total_Bytes:12);
  225.          Write(Lst,'            bytes/cluster =',Cluster_Size:6);
  226.          Writeln(Lst,'        free disk space =',Free_Bytes:12);
  227.          Writeln(Lst);
  228.          Count_Print_Lines(3);
  229.       end;
  230.    end;
  231. end;
  232.  
  233.  
  234. (* *************************************** Position a new filename *)
  235. (* When a new filename is found, this routine is used to locate it *)
  236. (* in the B-TREE that will be used to sort the filenames alphabet- *)
  237. (* ically.                                                         *)
  238. procedure Position_A_New_Filename(Root, New : Filerec);
  239. var    Index   : integer;
  240.        Done    : boolean;
  241. begin
  242.    Index := 1;
  243.    Done := FALSE;
  244.    repeat
  245.       if New^.FileData.Name < Root^.FileData.Name then begin
  246.          Done := TRUE;
  247.          if Root^.Left = nil then Root^.Left := New
  248.          else
  249.             Position_A_New_Filename(Root^.Left,New);
  250.       end
  251.       else if New^.FileData.Name > Root^.FileData.Name then
  252.       begin
  253.          Done := TRUE;
  254.          if Root^.Right = nil then
  255.             Root^.Right := New
  256.          else
  257.             Position_A_New_Filename(Root^.Right,New);
  258.       end;
  259.       Index := Index +1;
  260.    until (Index = 13) or Done;
  261. end;
  262.  
  263.  
  264. (* ************************************************** Print a file *)
  265. (* This is used to print the data for one complete file.  It is    *)
  266. (* called with a pointer to the root and an attribute that is to be*)
  267. (* printed.  Either the directories are printed (attribute = $10), *)
  268. (* or the files are printed.                                       *)
  269. procedure Print_A_File(Root : Filerec;
  270.                        Which_List : Output_Type);
  271. var Index,Temp  : byte;
  272. begin
  273.    Temp := Root^.FileData.Attr;
  274.    if ((Temp =  $10) and (Which_List = Directories)) or
  275.                  ((Temp <> $10) and (Which_List = Files)) then begin
  276.       Write('                ');
  277.       case Temp of
  278.          $27 : Write('<HID>  ');
  279.          $10 : Write('<DIR>  ');
  280.          $20 : Write('       ')
  281.          else  Write('<',Temp:3,'>  ');
  282.       end;   (* of case *)
  283.       if Do_We_Print then begin
  284.          Write(Lst,'                ');
  285.          case Temp of
  286.             $27 : Write(Lst,'<HID>  ');
  287.             $10 : Write(Lst,'<DIR>  ');
  288.             $20 : Write(Lst,'       ')
  289.             else  Write(Lst,'<',Temp:3,'>  ');
  290.          end;   (* of case *)
  291.       end;
  292.                                          (* Write out the filename *)
  293.       Write(Root^.FileData.Name);
  294.       for Index := 1 to (15 - Length(Root^.FileData.Name)) do
  295.          Write(' ');
  296.       if Do_We_Print then begin
  297.          Write(Lst,Root^.FileData.Name);
  298.          for Index := 1 to (15 - Length(Root^.FileData.Name)) do
  299.             Write(Lst,' ');
  300.       end;
  301.                                         (* Write out the file size *)
  302.       Write(Root^.FileData.Size:9);
  303.       if Do_We_Print then
  304.          Write(Lst,Root^.FileData.Size:9);
  305.                                (* Write out the file date and time *)
  306.       UnpackTime(Root^.FileData.Time, Date_Time_Rec);
  307.       Write('   ',Date_Time_Rec.Month:2,'/');
  308.       Write(Date_Time_Rec.Day:2,'/');
  309.       Write(Date_Time_Rec.Year,'   ');
  310.       Write('  ',Date_Time_Rec.Hour:2,':');
  311.       Writeln(Date_Time_Rec.Min:2);
  312.       if Do_We_Print then begin
  313.          Write(Lst,'   ',Date_Time_Rec.Month:2,'/');
  314.          Write(Lst,Date_Time_Rec.Day:2,'/');
  315.          Write(Lst,Date_Time_Rec.Year,'   ');
  316.          Write(Lst,'  ',Date_Time_Rec.Hour:2,':');
  317.          Writeln(Lst,Date_Time_Rec.Min:2);
  318.          Count_Print_Lines(1);
  319.       end;
  320.    end;
  321. end;
  322.  
  323. (* ********************************************* Print a directory *)
  324. (* This is a recursive routine to print out the filenames in alpha-*)
  325. (* betical order.  It uses a B-TREE with "infix" notation.  The    *)
  326. (* actual printing logic was removed to another procedure so that  *)
  327. (* the recursive part of the routine would not be too large and    *)
  328. (* fill up the heap too fast.                                      *)
  329. procedure Print_A_Directory(Root         : Filerec;
  330.                             Which_List   : Output_Type);
  331. begin
  332.    if Root^.Left <> nil then
  333.       Print_A_Directory(Root^.Left,Which_List);
  334.  
  335.    Print_A_File(Root,Which_List);        (* Write out the filename *)
  336.  
  337.    if Root^.Right <> nil then
  338.       Print_A_Directory(Root^.Right,Which_List);
  339. end;
  340.  
  341. (* **************************************************** Erase tree *)
  342. (* After the directory is printed and counted, it must be erased or*)
  343. (* the "heap" may overflow for a large disk with a lot of files.   *)
  344. procedure Erase_Tree(Root : Filerec);
  345. begin
  346.    if Root^.Left  <> nil then Erase_Tree(Root^.Left);
  347.    if Root^.Right <> nil then Erase_Tree(Root^.Right);
  348.    Dispose(Root);
  349. end;
  350.  
  351. (* ************************************************ Do A Directory *)
  352. (* This procedure reads all entries in any directory and sorts the *)
  353. (* filenames alphabetically.  Then it prints out the complete stat-*)
  354. (* istics, and calls itself to do all of the same things for each  *)
  355. (* of its own subdirectories.  Since each subdirectory also calls  *)
  356. (* each of its subdirectories, the recursion continues until there *)
  357. (* are no more subdirectories.                                     *)
  358. procedure Do_A_Directory(Input_Mask : Command_String);
  359. var   Mask          : Command_String;
  360.       Count,Index   : integer;
  361.       Cluster_Count : longint;
  362.       Cluster_Bytes : longint;
  363.       Byte_Count    : longint;
  364.       Tree_Root     : Filerec;                (* Root of file tree *)
  365.       Dir_Root      : Dir_Rec;
  366.       Dir_Point     : Dir_Rec;
  367.       Dir_Last      : Dir_Rec;
  368.       File_Record   : SearchRec;
  369.  
  370.     (* This embedded procedure is called upon to store all of the  *)
  371.     (* directory names in a linear linked list rather than a       *)
  372.     (* B-TREE since it should be rather short and efficiency of    *)
  373.     (* sorting is not an issue.  A bubble sort will be used on it. *)
  374.     procedure Store_Dir_Name;
  375.     begin
  376.        if File_Record.Attr = $10 then begin (* Pick out directories*)
  377.                     (* Directory name found, ignore if it is a '.' *)
  378.           if File_Record.Name[1] <> '.' then begin
  379.              New(Dir_Point);
  380.              Dir_Point^.Dir_Name := File_Record.Name;
  381.              Dir_Point^.Next := nil;
  382.              if Dir_Root = nil then
  383.                 Dir_Root := Dir_Point
  384.              else
  385.                 Dir_Last^.Next := Dir_Point;
  386.              Dir_Last := Dir_Point;
  387.           end;
  388.        end;
  389.     end;
  390.  
  391.      (* This is the procedure that sorts the directory names after *)
  392.      (* they are all accumulated.  It uses a bubble sort technique *)
  393.      (* which is probably the most inefficient sort available.  It *)
  394.      (* is perfectly acceptable for what is expected to be a very  *)
  395.      (* short list each time it is called.  More than 30 or 40     *)
  396.      (* subdirectories in one directory would not be good practice *)
  397.      (* but this routine would sort any number given to it.        *)
  398.      procedure Sort_Dir_Names;
  399.      var Change      : byte;
  400.          Save_String : string[15];
  401.          Dir_Next    : Dir_Rec;
  402.      begin
  403.         repeat
  404.            Change := 0;
  405.            Dir_Point := Dir_Root;
  406.            while Dir_Point^.Next <> nil do
  407.               begin
  408.               Dir_Next := Dir_Point^.Next;
  409.               Save_String := Dir_Next^.Dir_Name;
  410.               if Save_String < Dir_Point^.Dir_Name then begin
  411.                  Dir_Next^.Dir_Name := Dir_Point^.Dir_Name;
  412.                  Dir_Point^.Dir_Name := Save_String;
  413.                  Change := 1;
  414.               end;
  415.               Dir_Point := Dir_Point^.Next;
  416.            end;
  417.         until Change = 0;    (* No swaps in this pass, we are done *)
  418.      end;
  419.  
  420. begin (* Do_A_Directory procedure *)
  421.    Count := 0;
  422.    Cluster_Count := 0;
  423.    Dir_Root := nil;
  424.    Mask := Input_Mask + '*.*';
  425.    Mask[Length(Mask) + 1] := Chr(0);    (* A trailing zero for DOS *)
  426.                                    (* Count all files and clusters *)
  427.    repeat
  428.       if Count = 0 then               (* Get first directory entry *)
  429.          FindFirst(Mask,$17,File_Record)
  430.       else                     (* Get additional directory entries *)
  431.          FindNext(File_Record);
  432.       if DosError = 0 then begin       (* A good filename is found *)
  433.          Count := Count +1;            (* Add one for a good entry *)
  434.  
  435.                            (* Count up the number of clusters used *)
  436.          Index := File_Record.Size div Cluster_size;
  437.          if File_Record.Size mod Cluster_Size > 0 then
  438.             Index := Index + 1;            (* If a fractional part *)
  439.          Cluster_Count := Cluster_Count + Index;
  440.          if Index = 0 then     (* This is a directory, one cluster *)
  441.             Cluster_Count := Cluster_Count + 1;
  442.          Store_Dir_Name;
  443.       end;
  444.    until DosError > 0;
  445.    Cluster_Bytes := Cluster_Count * Cluster_Size;
  446.    Directory_Count := Directory_Count + 1;
  447.    Write('    ',Directory_Count:3,'. ');
  448.    Write(Input_Mask);
  449.    for Index := 1 to (32 - Length(Input_Mask)) do Write(' ');
  450.    Writeln(Count:4,' Files  Cbytes =',Cluster_Bytes:9);
  451.    if Do_We_Print then begin
  452.       Write(Lst,'    ',Directory_Count:3,'. ');
  453.       Write(Lst,Input_Mask);
  454.       for Index := 1 to (32 - Length(Input_Mask)) do Write(Lst,' ');
  455.       Writeln(Lst,Count:4,' Files  Cbytes =',Cluster_Bytes:9);
  456.       Count_Print_Lines(1);
  457.    end;
  458.    Total_Cbytes := Total_Cbytes + Cluster_Bytes;
  459.    All_Files := All_Files + Count;
  460.  
  461.                            (* files counted and clusters counted   *)
  462.                            (* Now read in only the requested files *)
  463.  
  464.    Count := 0;
  465.    Byte_Count := 0;
  466.    Tree_Root := nil;
  467.    if No_Files_Out <> TRUE then begin
  468.       Mask := Input_Mask + File_Request;
  469.       Mask[Length(Mask) + 1] := Chr(0); (* A trailing zero for DOS *)
  470.       repeat
  471.          New(File_Point);
  472.          if Count = 0 then            (* Get first directory entry *)
  473.             FindFirst(Mask,$17,File_Record)
  474.          else                  (* Get additional directory entries *)
  475.             FindNext(File_Record);
  476.          if DosError = 0 then begin    (* A good filename is found *)
  477.             Count := Count +1;         (* Add one for a good entry *)
  478.             File_Point^.Left := nil;
  479.             File_Point^.Right := nil;
  480.             File_Point^.FileData := File_Record;
  481.             if Tree_Root = nil then begin (* Pt to 1st elem in tree*)
  482.                Tree_Root := File_Point;
  483.             end
  484.             else begin     (* Point to additional elements in tree *)
  485.                Position_A_New_Filename(Tree_Root,File_Point);
  486.             end;
  487.  
  488.             Byte_Count := Byte_Count + File_Record.Size;
  489.          end;
  490.       until DosError > 0;
  491.    end;
  492.  
  493.    if Tree_Root <> nil then
  494.       Print_A_Directory(Tree_Root,Directories);
  495.    if Tree_Root <> nil then
  496.       Print_A_Directory(Tree_Root,Files);
  497.    if Count > 0 then begin
  498.       Writeln('                  ',Count:5,' Files ',
  499.                                  Byte_Count:17,' Bytes');
  500.       Writeln;
  501.       if Do_We_Print then begin
  502.          Writeln(Lst,'                  ',Count:5,' Files ',
  503.                                     Byte_Count:17,' Bytes');
  504.          Writeln(Lst);
  505.          Count_Print_Lines(2);
  506.       end;
  507.       Total_Bytes := Total_Bytes + Byte_Count;
  508.       Req_Files := Req_Files + Count;
  509.    end;
  510.                             (* Now go do all of the subdirectories *)
  511.    if Dir_Root <> nil then Sort_Dir_Names;
  512.    Dir_Point := Dir_Root;
  513.    while Dir_Point <> nil do begin
  514.       Mask := Input_Mask + Dir_Point^.Dir_Name + '\';
  515.       Do_A_Directory(Mask);
  516.       Dir_Point := Dir_Point^.Next;
  517.    end;
  518.                            (* Finally, erase the tree and the list *)
  519.    if Tree_Root <> nil then
  520.       Erase_Tree(Tree_Root);
  521.  
  522.    while Dir_Root <> nil do begin
  523.       Dir_Point := Dir_Root^.Next;
  524.       Dispose(Dir_Root);
  525.       Dir_Root := Dir_Point;
  526.    end;
  527. end;
  528.  
  529. (* ******************************************* Output Summary Data *)
  530. procedure Output_Summary_Data;
  531.  
  532. begin
  533.    Writeln;
  534.    Write('                     ',Req_Files:5,' Files');
  535.    Writeln(Total_Bytes:15,' Bytes in request');
  536.    Write('                     ',All_Files:5,' Files');
  537.    Writeln(Total_Cbytes:15,' Cbytes in tree');
  538.    Write('                                   ');
  539.    Free_Bytes := Free_Clusters * Cluster_Size;
  540.    Writeln(Free_Bytes:12,' Bytes free on disk');
  541.    if Do_We_Print then begin
  542.       Writeln(Lst);
  543.       Write(Lst,'                     ',Req_Files:5,' Files');
  544.       Writeln(Lst,Total_Bytes:15,' Bytes in request');
  545.       Write(Lst,'                     ',All_Files:5,' Files');
  546.       Writeln(Lst,Total_Cbytes:15,' Cbytes in tree');
  547.       Write(Lst,'                                   ');
  548.       Writeln(Lst,Free_Bytes:12,' Bytes free on disk');
  549.       Count_Print_Lines(4);      (* Signal the end, space paper up *)
  550.    end;
  551. end;
  552.  
  553. begin  (* Main program - Oak Tree ******************************** *)
  554.    Initialize;
  555.    Read_And_Parse_Command_Arguments;
  556.    Print_Header;
  557.    Do_A_Directory(Starting_Path);
  558.    Output_Summary_Data;
  559.    Count_Print_Lines(255);
  560. end.  (* Main Program *)
  561.